<template>
  <el-button icon="el-icon-delete" @click="resetHandler">重置</el-button>
</template>
<script>
export default {
  name: 'ResetButton',
  props: {
    searchForm: {
      type: Object,
      required: true,
    },
    search: {
      type: Function,
      required: true,
    },
  },
  methods: {
    resetHandler() {
      for (const key in this.searchForm) {
        this.searchForm[key] = ''
      }
      this.search(1)
    },
  },
}
</script>
